<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/jquery.min.js"></script>
		<script src="js/jquery-1.10.2.js"></script> 
		//兼容ie8
	</head>

	<body>
		<span></span>
		<script type="text/javascript">
			function getversion(){
				var ua = navigator.userAgent.toLowerCase();
				console.log(ua)
				console.log(ua.match(/msie ([\d.]+)/))
				var s;
				if(ua.match(/rv:([\d.]+)\) like gecko/)){
					var Sys = {
						br:'IE',
						ver:ua.match(/rv:([\d.]+)\) like gecko/)[1]  //ie11
					}
				}else if(ua.match(/msie ([\d.]+)/)){
					var Sys = {
						br:'IE',
						ver:ua.match(/msie ([\d.]+)/)[1] //ie10以下
					}
				}else if(ua.match(/firefox\/([\d.]+)/)){
					var Sys = {
						br:'Firefox',
						ver:ua.match(/firefox\/([\d.]+)/)[1]
					}
				}else if(ua.match(/chrome\/([\d.]+)/)){
					var Sys = {
						br:'chrome',
						ver:ua.match(/chrome\/([\d.]+)/)[1]
					}

				}else if(ua.match(/opera.([\d.]+)/)){
					var Sys = {
						br:'opera',
						ver:ua.match(/opera.([\d.]+)/)[1]
					}
				}else if(ua.match(/version\/([\d.]+).*safari/)){
					var Sys = {
						br:'opera',
						ver:ua.match(/version\/([\d.]+).*safari/)[1]
					}
				}else{
					var Sys = {
						br:'',
						ver:''
					}
				}
				
//				(s = ua.match(/rv:([\d.]+)\) like gecko/)) ? Sys.br = s[1]:
				
//					(s = ua.match(/msie ([\d.]+)/)) ? Sys.br = s[1] :
//					(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.br = s[1] :
//					(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.br = s[1] :
//					(s = ua.match(/opera.([\d.]+)/)) ? Sys.br = s[1] :
//					(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.br = s[1] : 0;

//				if(Sys.ie) $('span').text('IE: ' + Sys.ie);
//				if(Sys.firefox) $('span').text('Firefox: ' + Sys.firefox);
//				if(Sys.chrome) $('span').text('Chrome: ' + Sys.chrome);
//				if(Sys.opera) $('span').text('Opera: ' + Sys.opera);
//				if(Sys.safari) $('span').text('Safari: ' + Sys.safari);
console.log(Sys)
				$('span').text(Sys.br + ' ' + Sys.ver)
			}
			
			
			getversion()
		</script>
	</body>

</html>